package com.aos.erp.schools.model.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.io.Serializable;
import java.util.Date;

/**
 * @program: erp
 * @description: 后台用户
 * @author: tanzhiyu
 * @create: 2018-10-31 10:10
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("后台用户")
@TableName("t_sys_user")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户ID", hidden = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("登陆账号|用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("登陆密码或者密码标识(比如密码md5)")
    @TableField("password")
    private String password;

    @ApiModelProperty("用户名字")
    @TableField("name")
    private String name;

    @ApiModelProperty("用户电子邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty("手机号")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty("性别 男:1;女:2;未知:3")
    @TableField("sex")
    private Integer sex;

    @ApiModelProperty(value = "密码加盐", hidden = true)
    @TableField("salt")
    private String salt;

    @ApiModelProperty(value = "备注", hidden = true)
    @TableField("comment")
    private String comment;

    @ApiModelProperty(value = "用户状态（-2:：删除，-1 ；-1：禁用；0：待激活 1：正常）", hidden = true)
    @TableField("state")
    private Integer state;

    @ApiModelProperty(value = "用户到期时间 （默认空表示长期）", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("expire_datetime")
    private Date expireDatetime;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("created")
    private Date created;

    @ApiModelProperty(value = "最后修改时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("updated")
    private Date updated;

    @ApiModelProperty(value = "最后登录时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("lastlogin_datetime")
    private Date lastloginDatetime;

    @ApiModelProperty(value = "操作人id", hidden = true)
    @TableField("operator_id")
    private Long operatorId;

    @ApiModelProperty(value = "用户类别 （1：傲雄  2：车管所  3：驾校 ）", hidden = true)
    @TableField("type")
    private Integer type;
}
